import redis
import config_py
def redis_connect():
    try:
        pool = redis.ConnectionPool(host=config_py.r_host, port=config_py.r_port,
                                    password=config_py.r_passwd, decode_responses=True)
        # r = redis.Redis(host='localhost', port='6379', password='666666', decode_responses=True)
        r = redis.Redis(connection_pool=pool)
        print(r)
        return r
    except:
        return error_sql.connect_error